package org.lyl.taobao.dao;

import org.lyl.taobao.api.entity.Commodity;

import java.sql.Connection;
import java.util.List;

/**
 * @Author: Re
 * @Date: 2021/4/2 16:17
 */
public interface ICommodityDao {
    /**
     * 增加商品接口
     * @param connection
     * @param commodity
     * @return
     */
    boolean insertCommodity(Connection connection, Commodity commodity);

    /**
     * 查看所有商品
     * @param connection
     * @return
     */
    List<Commodity> checkAllCommodity(Connection connection);

    /**
     * 根据商品id查询商品
     * @param connection
     * @param c_Id
     * @return
     */
    Commodity checkCommodityByC_Id(Connection connection,Integer c_Id);

    /**
     * 根据商家名查看商品
     * @param connection
     * @param UserId
     * @return
     */
    List<Commodity> checkCommodityById(Connection connection,Integer UserId);

    /**
     * 根据商品id
     * @param connection
     * @param c_id
     * @return
     */
    boolean deleteCommodity(Connection connection,int c_id);

    /**
     * 更改商品信息
     * @param connection
     * @param c_Id
     * @param c_Name
     * @param c_Price
     * @return
     */
    boolean updateCommodity(Connection connection,int c_Id,String c_Name,float c_Price);

    /**
     * 查看商品价格
     * @param connection
     * @param c_Id
     * @return
     */
    float getCommodityPriceByC_Id(Connection connection,Integer c_Id);
}
